- @title = t('families.show.heading', family: @family.name)
- map_header(@family) if @family.show_attribute_to?(:address, @logged_in)

- if show_family_name_suggestion
  .callout.callout-warning
    = icon 'fa fa-info-circle'
    = t('families.show.suggested_name_html', count: @family.people.undeleted.adults.count, first: @family.people.undeleted.adults.first.try(:name), second: @family.people.undeleted.adults.second.try(:name), url: edit_family_path(@family), name: @family.suggested_name)

- if @family.updates.pending.any? and @logged_in.can_update?(@family)
  .callout.callout-info
    = icon 'fa fa-clock-o'
    = t('families.updates.pending_callout')

.row
  .col-md-6
    = avatar_tag @family, size: :large, class: 'fit-width'

    %table.table
      - if @family.show_attribute_to?(:home_phone, @logged_in)
        %tr
          %td= t('.table.home_phone')
          %td= link_to_phone @family.home_phone
      - if @family.show_attribute_to?(:address, @logged_in)
        %tr
          %td= t('.table.address')
          %td
            = preserve_breaks @family.address
            %br
            == #{@family.city}, #{@family.state} #{@family.short_zip}
            %br
            = link_to t('.table.map'), "https://www.google.com/maps/place/#{@family.address.tr("\n","")} #{@family.city}, #{@family.state} #{@family.short_zip}/", :target => "_blank"
      - if anniversary = @family.anniversary_sharable_with(@logged_in)
        %tr
          %td= t('.table.anniversary')
          %td= anniversary.to_s(:date_without_year)

  .col-md-6
    %table.table.family
      %tbody.sortable
        - @people.each do |person|
          %tr.row-with-avatar{ data: {update_position_path: update_position_family_person_path(@family, person)} }
            - if @logged_in.can_reorder?(@family)
              %td.handle
                = icon 'fa fa-reorder', style: 'color: #999'
            %td.avatar= link_to avatar_tag(person), person
            %td
              = link_to person.name, person
              - unless person.visible?
                %i.fa.fa-lock
            %td.actions
              - if @logged_in.can_update?(person)
                = link_to edit_person_path(person), class: 'btn btn-info btn-xs' do
                  = icon 'fa fa-pencil'
              - if @logged_in.can_delete?(person)
                = link_to person, data: { method: 'delete', confirm: t('are_you_sure') },  class: 'btn btn-delete btn-xs text-red' do
                  = icon 'fa fa-trash-o'

    - if @logged_in.can_update?(@family)
      .page-controls
        = link_to edit_family_path(@family), class: 'btn btn-info' do
          = icon 'fa fa-pencil'
          = t('families.show.edit_link')
        - if @logged_in.admin?(:edit_profiles)
          = link_to new_family_person_path(@family), class: 'btn btn-success' do
            = icon 'fa fa-plus-circle'
            = t('families.add.new')
          = link_to family_search_path(@family), class: 'btn btn-warning' do
            = icon 'fa fa-arrow-circle-left'
            = t('families.add.existing')
          = link_to @family, data: { method: 'delete', confirm: t('are_you_sure') }, class: 'btn btn-danger' do
            = icon 'fa fa-trash-o'
            = t('families.delete.button')
